package com.sporadic.backstage.controller;

import com.sporadic.backstage.entity.DiningTableStatus;
import com.sporadic.backstage.service.DiningTableStatusService;
import com.sun.org.apache.regexp.internal.RE;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@CrossOrigin(origins = {"http://localhost:8080"}, methods = {RequestMethod.GET, RequestMethod.POST}, allowCredentials = "true")
@Controller
public class DiningTableStatusController {

    @Autowired
    private DiningTableStatusService diningTableStatusService;

    @RequestMapping("/findDiningTableStatus")
    @ResponseBody
    public List<DiningTableStatus> findDiningTableStatus(){
        return  diningTableStatusService.findDiningTableStatus();
    }

}
